﻿/**
 * @file NisDateTime_Struct.h
 * @brief NisDateTime
 * @details 
 * @mainpage http://www.navinfo.com/
 * @author Navinfo
 * @email 400-810-0880
 * @license Navinfo Co.,Ltd. All rights reserved
 */
#ifndef	__NISDATETIMESTRUCT_H_
#define	__NISDATETIMESTRUCT_H_

PRAGMA_PACK_PUSH

namespace Navinfo {
namespace Nis {

class CTimeOfDay;
class CTimeRangeOfDay;
class CDayOfYear;
class CDateRangeOfYear;
class CDaysOfWeek;
class CDaysOfMonth;
class CMonthsOfYear;



/**
 * @brief 小时、分
 * 
 */
class DLL_PUBLIC CTimeOfDay
{
public:
	CTimeOfDay();

	explicit CTimeOfDay(
		ushort v_ 
		);

public:
	/**
	 * @brief 取得Minutes
	 * @details 
	 *
	 * @return 分
	 */
	ushort GetMinutes() const;

	/**
	 * @brief 取得Hours
	 * @details 
	 *
	 * @return 小时
	 */
	ushort GetHours() const;


public:
	union {
		ushort													v;
		struct {
			ushort												m_ucMinutes					: 6;			///<	  分  
			ushort												m_ucHours					: 5;			///<	  小时  
		};
	};
};


/**
 * @brief 时间范围
 * 
 */
class DLL_PUBLIC CTimeRangeOfDay
{
public:
	CTimeRangeOfDay();

	explicit CTimeRangeOfDay(
		  const CTimeOfDay &m_clStartTime_
		, const CTimeOfDay &m_clEndTime_ = CTimeOfDay()
		, const uchar &m_ucIsInclusive_ = 0
		);

public:
	/**
	 * @brief 取得StartTime
	 *
	 * @return 起始时间
	 */
	const CTimeOfDay& GetStartTime() const;

	/**
	 * @brief 取得EndTime
	 *
	 * @return 结束时间
	 */
	const CTimeOfDay& GetEndTime() const;

	/**
	 * @brief 取得IsInclusive
	 *
	 * @return 如果设置为true，则指定的时间内有效；如果设置为false，则指定的时间以外有效
	 */
	Navinfo::Nis::BOOL GetIsInclusive() const;


public:
	CTimeOfDay													m_clStartTime;								///<	  起始时间  
	CTimeOfDay													m_clEndTime;								///<	  结束时间  
	uchar														m_ucIsInclusive;							///<	  如果设置为true，则指定的时间内有效；如果设置为false，则指定的时间以外有效  
};


/**
 * @brief 年、月、日
 * 
 */
class DLL_PUBLIC CDayOfYear
{
public:
	CDayOfYear();

	explicit CDayOfYear(
		  const short &m_sYear_
		, const uchar &m_ucMonth_ = 0
		, const uchar &m_ucDay_ = 0
		, const uchar &m_ucIsInclusive_ = 0
		);

public:
	/**
	 * @brief 取得Year
	 *
	 * @return 年
	 */
	const short& GetYear() const;

	/**
	 * @brief 取得Month
	 *
	 * @return 月
	 */
	const uchar& GetMonth() const;

	/**
	 * @brief 取得Day
	 *
	 * @return 日
	 */
	const uchar& GetDay() const;

	/**
	 * @brief 取得IsInclusive
	 *
	 * @return 如果设置为true，则指定的日期有效。否则所有其他日期均有效。
	 */
	Navinfo::Nis::BOOL GetIsInclusive() const;


public:
	short														m_sYear;									///<	  年  
	uchar														m_ucMonth;									///<	  月  
	uchar														m_ucDay;									///<	  日  
	uchar														m_ucIsInclusive;							///<	  如果设置为true，则指定的日期有效。否则所有其他日期均有效。  
};


/**
 * @brief 日期范围
 * 
 */
class DLL_PUBLIC CDateRangeOfYear
{
public:
	CDateRangeOfYear();

	explicit CDateRangeOfYear(
		  const CDayOfYear &m_clStartDay_
		, const CDayOfYear &m_clEndDay_ = CDayOfYear()
		, const uchar &m_ucIsInclusive_ = 0
		);

public:
	/**
	 * @brief 取得StartDay
	 *
	 * @return 起始日期
	 */
	const CDayOfYear& GetStartDay() const;

	/**
	 * @brief 取得EndDay
	 *
	 * @return 结束日期
	 */
	const CDayOfYear& GetEndDay() const;

	/**
	 * @brief 取得IsInclusive
	 *
	 * @return 如果设置为true，则指定的时间内有效；如果设置为false，则指定的时间以外有效
	 */
	Navinfo::Nis::BOOL GetIsInclusive() const;


public:
	CDayOfYear													m_clStartDay;								///<	  起始日期  
	CDayOfYear													m_clEndDay;									///<	  结束日期  
	uchar														m_ucIsInclusive;							///<	  如果设置为true，则指定的时间内有效；如果设置为false，则指定的时间以外有效  
};


/**
 * @brief 星期
 * 
 */
class DLL_PUBLIC CDaysOfWeek
{
public:
	CDaysOfWeek();

	explicit CDaysOfWeek(
		uchar v_ 
		);

public:
	/**
	 * @brief 取得IsInclusive
	 * @details 
	 *
	 * @return 如果设置为true，则指定的星期几有效。否则所有其他日期均有效
	 */
	Navinfo::Nis::BOOL GetIsInclusive() const;

	/**
	 * @brief 取得IsSaturday
	 * @details 
	 *
	 * @return 星期六
	 */
	Navinfo::Nis::BOOL GetIsSaturday() const;

	/**
	 * @brief 取得IsFriday
	 * @details 
	 *
	 * @return 星期五
	 */
	Navinfo::Nis::BOOL GetIsFriday() const;

	/**
	 * @brief 取得IsThursday
	 * @details 
	 *
	 * @return 星期四
	 */
	Navinfo::Nis::BOOL GetIsThursday() const;

	/**
	 * @brief 取得IsWednesday
	 * @details 
	 *
	 * @return 星期三
	 */
	Navinfo::Nis::BOOL GetIsWednesday() const;

	/**
	 * @brief 取得IsTuesday
	 * @details 
	 *
	 * @return 星期二
	 */
	Navinfo::Nis::BOOL GetIsTuesday() const;

	/**
	 * @brief 取得IsMonday
	 * @details 
	 *
	 * @return 星期一
	 */
	Navinfo::Nis::BOOL GetIsMonday() const;

	/**
	 * @brief 取得IsSunday
	 * @details 
	 *
	 * @return 星期日
	 */
	Navinfo::Nis::BOOL GetIsSunday() const;


public:
	union {
		uchar													v;
		struct {
			uchar												m_ucIsInclusive				: 1;			///<	  如果设置为true，则指定的星期几有效。否则所有其他日期均有效  
			uchar												m_ucIsSaturday				: 1;			///<	  星期六  
			uchar												m_ucIsFriday				: 1;			///<	  星期五  
			uchar												m_ucIsThursday				: 1;			///<	  星期四  
			uchar												m_ucIsWednesday				: 1;			///<	  星期三  
			uchar												m_ucIsTuesday				: 1;			///<	  星期二  
			uchar												m_ucIsMonday				: 1;			///<	  星期一  
			uchar												m_ucIsSunday				: 1;			///<	  星期日  
		};
	};
};


/**
 * @brief 日
 * 
 */
class DLL_PUBLIC CDaysOfMonth
{
public:
	CDaysOfMonth();

	explicit CDaysOfMonth(
		uint v_ 
		);

public:
	/**
	 * @brief 取得IsInclusive
	 * @details 
	 *
	 * @return IsInclusive
	 */
	Navinfo::Nis::BOOL GetIsInclusive() const;

	/**
	 * @brief 取得IsDay31
	 * @details 
	 *
	 * @return IsDay31
	 */
	Navinfo::Nis::BOOL GetIsDay31() const;

	/**
	 * @brief 取得IsDay30
	 * @details 
	 *
	 * @return IsDay30
	 */
	Navinfo::Nis::BOOL GetIsDay30() const;

	/**
	 * @brief 取得IsDay29
	 * @details 
	 *
	 * @return IsDay29
	 */
	Navinfo::Nis::BOOL GetIsDay29() const;

	/**
	 * @brief 取得IsDay28
	 * @details 
	 *
	 * @return IsDay28
	 */
	Navinfo::Nis::BOOL GetIsDay28() const;

	/**
	 * @brief 取得IsDay27
	 * @details 
	 *
	 * @return IsDay27
	 */
	Navinfo::Nis::BOOL GetIsDay27() const;

	/**
	 * @brief 取得IsDay26
	 * @details 
	 *
	 * @return IsDay26
	 */
	Navinfo::Nis::BOOL GetIsDay26() const;

	/**
	 * @brief 取得IsDay25
	 * @details 
	 *
	 * @return IsDay25
	 */
	Navinfo::Nis::BOOL GetIsDay25() const;

	/**
	 * @brief 取得IsDay24
	 * @details 
	 *
	 * @return IsDay24
	 */
	Navinfo::Nis::BOOL GetIsDay24() const;

	/**
	 * @brief 取得IsDay23
	 * @details 
	 *
	 * @return IsDay23
	 */
	Navinfo::Nis::BOOL GetIsDay23() const;

	/**
	 * @brief 取得IsDay22
	 * @details 
	 *
	 * @return IsDay22
	 */
	Navinfo::Nis::BOOL GetIsDay22() const;

	/**
	 * @brief 取得IsDay21
	 * @details 
	 *
	 * @return IsDay21
	 */
	Navinfo::Nis::BOOL GetIsDay21() const;

	/**
	 * @brief 取得IsDay20
	 * @details 
	 *
	 * @return IsDay20
	 */
	Navinfo::Nis::BOOL GetIsDay20() const;

	/**
	 * @brief 取得IsDay19
	 * @details 
	 *
	 * @return IsDay19
	 */
	Navinfo::Nis::BOOL GetIsDay19() const;

	/**
	 * @brief 取得IsDay18
	 * @details 
	 *
	 * @return IsDay18
	 */
	Navinfo::Nis::BOOL GetIsDay18() const;

	/**
	 * @brief 取得IsDay17
	 * @details 
	 *
	 * @return IsDay17
	 */
	Navinfo::Nis::BOOL GetIsDay17() const;

	/**
	 * @brief 取得IsDay16
	 * @details 
	 *
	 * @return IsDay16
	 */
	Navinfo::Nis::BOOL GetIsDay16() const;

	/**
	 * @brief 取得IsDay15
	 * @details 
	 *
	 * @return IsDay15
	 */
	Navinfo::Nis::BOOL GetIsDay15() const;

	/**
	 * @brief 取得IsDay14
	 * @details 
	 *
	 * @return IsDay14
	 */
	Navinfo::Nis::BOOL GetIsDay14() const;

	/**
	 * @brief 取得IsDay13
	 * @details 
	 *
	 * @return IsDay13
	 */
	Navinfo::Nis::BOOL GetIsDay13() const;

	/**
	 * @brief 取得IsDay12
	 * @details 
	 *
	 * @return IsDay12
	 */
	Navinfo::Nis::BOOL GetIsDay12() const;

	/**
	 * @brief 取得IsDay11
	 * @details 
	 *
	 * @return IsDay11
	 */
	Navinfo::Nis::BOOL GetIsDay11() const;

	/**
	 * @brief 取得IsDay10
	 * @details 
	 *
	 * @return IsDay10
	 */
	Navinfo::Nis::BOOL GetIsDay10() const;

	/**
	 * @brief 取得IsDay9
	 * @details 
	 *
	 * @return IsDay9
	 */
	Navinfo::Nis::BOOL GetIsDay9() const;

	/**
	 * @brief 取得IsDay8
	 * @details 
	 *
	 * @return IsDay8
	 */
	Navinfo::Nis::BOOL GetIsDay8() const;

	/**
	 * @brief 取得IsDay7
	 * @details 
	 *
	 * @return IsDay7
	 */
	Navinfo::Nis::BOOL GetIsDay7() const;

	/**
	 * @brief 取得IsDay6
	 * @details 
	 *
	 * @return IsDay6
	 */
	Navinfo::Nis::BOOL GetIsDay6() const;

	/**
	 * @brief 取得IsDay5
	 * @details 
	 *
	 * @return IsDay5
	 */
	Navinfo::Nis::BOOL GetIsDay5() const;

	/**
	 * @brief 取得IsDay4
	 * @details 
	 *
	 * @return IsDay4
	 */
	Navinfo::Nis::BOOL GetIsDay4() const;

	/**
	 * @brief 取得IsDay3
	 * @details 
	 *
	 * @return IsDay3
	 */
	Navinfo::Nis::BOOL GetIsDay3() const;

	/**
	 * @brief 取得IsDay2
	 * @details 
	 *
	 * @return IsDay2
	 */
	Navinfo::Nis::BOOL GetIsDay2() const;

	/**
	 * @brief 取得IsDay1
	 * @details 
	 *
	 * @return IsDay1
	 */
	Navinfo::Nis::BOOL GetIsDay1() const;


public:
	union {
		uint													v;
		struct {
			uint												m_ucIsInclusive				: 1;			///<	  IsInclusive  
			uint												m_ucIsDay31					: 1;			///<	  IsDay31  
			uint												m_ucIsDay30					: 1;			///<	  IsDay30  
			uint												m_ucIsDay29					: 1;			///<	  IsDay29  
			uint												m_ucIsDay28					: 1;			///<	  IsDay28  
			uint												m_ucIsDay27					: 1;			///<	  IsDay27  
			uint												m_ucIsDay26					: 1;			///<	  IsDay26  
			uint												m_ucIsDay25					: 1;			///<	  IsDay25  
			uint												m_ucIsDay24					: 1;			///<	  IsDay24  
			uint												m_ucIsDay23					: 1;			///<	  IsDay23  
			uint												m_ucIsDay22					: 1;			///<	  IsDay22  
			uint												m_ucIsDay21					: 1;			///<	  IsDay21  
			uint												m_ucIsDay20					: 1;			///<	  IsDay20  
			uint												m_ucIsDay19					: 1;			///<	  IsDay19  
			uint												m_ucIsDay18					: 1;			///<	  IsDay18  
			uint												m_ucIsDay17					: 1;			///<	  IsDay17  
			uint												m_ucIsDay16					: 1;			///<	  IsDay16  
			uint												m_ucIsDay15					: 1;			///<	  IsDay15  
			uint												m_ucIsDay14					: 1;			///<	  IsDay14  
			uint												m_ucIsDay13					: 1;			///<	  IsDay13  
			uint												m_ucIsDay12					: 1;			///<	  IsDay12  
			uint												m_ucIsDay11					: 1;			///<	  IsDay11  
			uint												m_ucIsDay10					: 1;			///<	  IsDay10  
			uint												m_ucIsDay9					: 1;			///<	  IsDay9  
			uint												m_ucIsDay8					: 1;			///<	  IsDay8  
			uint												m_ucIsDay7					: 1;			///<	  IsDay7  
			uint												m_ucIsDay6					: 1;			///<	  IsDay6  
			uint												m_ucIsDay5					: 1;			///<	  IsDay5  
			uint												m_ucIsDay4					: 1;			///<	  IsDay4  
			uint												m_ucIsDay3					: 1;			///<	  IsDay3  
			uint												m_ucIsDay2					: 1;			///<	  IsDay2  
			uint												m_ucIsDay1					: 1;			///<	  IsDay1  
		};
	};
};


/**
 * @brief 月
 * 
 */
class DLL_PUBLIC CMonthsOfYear
{
public:
	CMonthsOfYear();

	explicit CMonthsOfYear(
		ushort v_ 
		);

public:
	/**
	 * @brief 取得IsInclusive
	 * @details 
	 *
	 * @return IsInclusive
	 */
	Navinfo::Nis::BOOL GetIsInclusive() const;

	/**
	 * @brief 取得December
	 * @details 
	 *
	 * @return December
	 */
	Navinfo::Nis::BOOL GetDecember() const;

	/**
	 * @brief 取得November
	 * @details 
	 *
	 * @return November
	 */
	Navinfo::Nis::BOOL GetNovember() const;

	/**
	 * @brief 取得October
	 * @details 
	 *
	 * @return October
	 */
	Navinfo::Nis::BOOL GetOctober() const;

	/**
	 * @brief 取得September
	 * @details 
	 *
	 * @return September
	 */
	Navinfo::Nis::BOOL GetSeptember() const;

	/**
	 * @brief 取得August
	 * @details 
	 *
	 * @return August
	 */
	Navinfo::Nis::BOOL GetAugust() const;

	/**
	 * @brief 取得July
	 * @details 
	 *
	 * @return July
	 */
	Navinfo::Nis::BOOL GetJuly() const;

	/**
	 * @brief 取得June
	 * @details 
	 *
	 * @return June
	 */
	Navinfo::Nis::BOOL GetJune() const;

	/**
	 * @brief 取得May
	 * @details 
	 *
	 * @return May
	 */
	Navinfo::Nis::BOOL GetMay() const;

	/**
	 * @brief 取得April
	 * @details 
	 *
	 * @return April
	 */
	Navinfo::Nis::BOOL GetApril() const;

	/**
	 * @brief 取得March
	 * @details 
	 *
	 * @return March
	 */
	Navinfo::Nis::BOOL GetMarch() const;

	/**
	 * @brief 取得February
	 * @details 
	 *
	 * @return February
	 */
	Navinfo::Nis::BOOL GetFebruary() const;

	/**
	 * @brief 取得January
	 * @details 
	 *
	 * @return January
	 */
	Navinfo::Nis::BOOL GetJanuary() const;


public:
	union {
		ushort													v;
		struct {
			ushort												m_ucIsInclusive				: 1;			///<	  IsInclusive  
			ushort												m_ucDecember				: 1;			///<	  December  
			ushort												m_ucNovember				: 1;			///<	  November  
			ushort												m_ucOctober					: 1;			///<	  October  
			ushort												m_ucSeptember				: 1;			///<	  September  
			ushort												m_ucAugust					: 1;			///<	  August  
			ushort												m_ucJuly					: 1;			///<	  July  
			ushort												m_ucJune					: 1;			///<	  June  
			ushort												m_ucMay						: 1;			///<	  May  
			ushort												m_ucApril					: 1;			///<	  April  
			ushort												m_ucMarch					: 1;			///<	  March  
			ushort												m_ucFebruary				: 1;			///<	  February  
			ushort												m_ucJanuary					: 1;			///<	  January  
		};
	};
};

}
}

PRAGMA_PACK_POP

#endif	//	__NISDATETIMESTRUCT_H_
